using System;
using System.Linq;
using System.Text;

namespace SM2Console
{
    internal class Program
    {
        static void Main(string[] args)
        {
            // SM2 加密公钥
            string publicKeyHex = "0468dc7b8c17ef0a7ea47d5e843862e523abc6d3df227ca3f808ec92f58098320030330a76103e553b3ad77985d444aa3bd494ccee688c92bd65e3e8de80b4509b";
            // SM2 加密私钥
            string privateKeyHex = "37ebf7f9783958ae93403289ac343e6ad3ea4467a128fe6a45d01dd0e7fecdbc";
            string planText = "你好";
            
            string encryptText = Sm2Util.Encrypt(planText, publicKeyHex);
            string decryptText = Sm2Util.Decrypt(encryptText, privateKeyHex);
            Console.WriteLine("planText:" + planText);
            Console.WriteLine("encryptText:" + encryptText);
            Console.WriteLine("decryptText:" + decryptText);


            // string encryptText = "048365B8723857D5A0928BF2D43890DF44B491ADE49A75E65213279A009AB3D6139041999E12AADEEA870F05EF911674FC95C8A1E61D99AC1EF0222F0371960E2D5E00E09C1113BDA5CE52D50F22C7A725FF57C9E14A18622D17DAC0922E3DB0CC36C85C00213D";
            // string decryptText = Sm2Util.Decrypt(encryptText, privateKeyHex);
            // Console.WriteLine("decryptText:" + decryptText);
            
            string encryptText1 = "7f63bfeb8789e576e7ec004507acb239f0b2e178bfd36de30fd0711bd491618414741d5103b8241abba869d6d49ce039d2377c59d570782f48e2929432b359250248bdab851fc40eeb9bb07658dc37ca13ab3afbc1e70154646c104e040c132fb5ae37e315a7c74ed2d272674da95e6348cff902";
            string decryptText1 = Sm2Helper.Decrypt(encryptText1, privateKeyHex);
            Console.WriteLine("decryptText:" + decryptText1);

            // Console.ReadLine();
        }
    }
}